/**
 * This file is part of Tamariba. Copyright (C) 2011 Michael Vogt <michael@tamariba.eu>, Patrick Hempel
 * <patrick@tamariba.eu>
 * 
 * Tamariba is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
 * 
 * Tamariba is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied
 * warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
 * 
 * You should have received a copy of the GNU General Public License along with Tamariba. If not, see
 * <http://www.gnu.org/licenses/>.
 */
package eu.tamariba.html.server.model;


import org.springframework.roo.addon.entity.RooEntity;
import org.springframework.roo.addon.javabean.RooJavaBean;
import org.springframework.roo.addon.tostring.RooToString;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size;
import java.util.Set;
import eu.tamariba.html.server.model.Task;
import java.util.HashSet;
import javax.persistence.ManyToMany;
import javax.persistence.CascadeType;


@RooJavaBean
@RooToString
@RooEntity
public class Tag {

   @NotNull
   @Size( min = 3, max = 40)
   private String name;

   @Size( max = 250)
   private String description;

   @NotNull
   private Integer sortorder;

   @ManyToMany( cascade = CascadeType.ALL)
   private Set<Task> tasks = new HashSet<Task>();
}
